package cn.ekuma.pos.pda.finder;

import java.util.ArrayList;
import java.util.List;

import com.openbravo.bean.crm.viewbean.ProductCustomerView;
import com.openbravo.bean.sales.SharedTicketInfo;
import com.openbravo.data.basic.BasicException;

import android.app.ProgressDialog;
import android.view.View;
import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.data.ui.android.AbstractBaseBeanListAdapter;
import cn.ekuma.data.ui.android.AbstractListFinderActivate;
import cn.ekuma.epos.datalogic.DataLogicPDA;
import cn.ekuma.epos.datalogic.I_DataLogicReceipts;
import cn.ekuma.pos.pda.finder.adapter.ShardTicketInfoAdapter;

public class ShardTicketFinder extends AbstractListFinderActivate<SharedTicketInfo>{

	public ShardTicketFinder() {
		super(DataLogicPDA.getDataLogicPDA());
	}

	private String  locationId="0"; 
	
	@Override
	public AbstractBaseBeanListAdapter getListAdapter() {
		return new ShardTicketInfoAdapter(this);
	}
	
	

	@Override
	protected void onResume() {
		super.onResume();
		onLoadData();
	}

	public void onLoadData() {
		final ProgressDialog dialog = ProgressDialog.show(this, "", 
		        "查旬中，请稍等 …", true, true);
		new Thread(){
			@Override
			public void run(){
				I_DataLogicReceipts dlreceipts=DataLogicPDA.getDLReceipts();
				try {
					List<SharedTicketInfo> lists=dlreceipts.getSharedTicketList(locationId);
					if(lists==null)
						lists=new ArrayList<SharedTicketInfo>();
					mHandler.obtainMessage(MSG_SUCCESS,lists).sendToTarget();//获取图片失败   
				} catch (BasicException e) {
					mHandler.obtainMessage(MSG_FAILURE).sendToTarget();//获取图片失败   
				}
				dialog.dismiss(); 
			}
			}.start();
	}

	@Override
	public void filterParaReset() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void initAdvSeachView() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isQuickSeachAble() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onQuickSeach(String inputText) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public View createFilterPanel() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public View createAdvFilterPanel() {
		// TODO Auto-generated method stub
		return null;
	}
}
